#ifndef SNSimpleClassifier_h__
#define SNSimpleClassifier_h__
//-----------------------------------------------------------------------------------
#include<vector>
#include <list>
//-----------------------------------------------------------------------------------

struct SNTrainingClassifierSample
{
	int Value;
	
	SNTrainingClassifierSample()
	{
	}
};
//-----------------------------------------------------------------------------------

struct SNWeakCascadeClassifier 
{
	int ValueIndex;
	int Sign;
	float Treshold;
	float Error;
	float Alpha;

	SNWeakCascadeClassifier()
	{
		Alpha = 0.0f;
		ValueIndex = -1;
		Sign = 0;
		Treshold = 0.0f;
		Error = 0.0f;
	}
};
//-----------------------------------------------------------------------------------

struct SNStrongCascadeClassifier : public std::list<SNWeakCascadeClassifier>
{
	std::vector<float> Weights;
};
//-----------------------------------------------------------------------------------
struct SNTrainingClassifierVector : public std::vector<SNTrainingClassifierSample>
{
	int Sign;
};
//-----------------------------------------------------------------------------------
typedef std::vector<SNTrainingClassifierVector> SNTrainingClassifierSet;
//-----------------------------------------------------------------------------------

class SNSimpleClassifier
{
public:
	SNSimpleClassifier();
	~SNSimpleClassifier();
	SNWeakCascadeClassifier Train(SNTrainingClassifierSet& data, SNStrongCascadeClassifier& classifier);
	void StrongTrain(SNTrainingClassifierSet& data, int rounds_count, SNStrongCascadeClassifier& classifier);
	int Classify(SNTrainingClassifierVector& item, SNWeakCascadeClassifier& classifier);
	int Classify(SNTrainingClassifierVector& data, SNStrongCascadeClassifier& classifier);
};
//-----------------------------------------------------------------------------------

#endif // SNSimpleClassifier_h__
